package com.google.code.tretris.rendering;


public class Cube extends MVComplexObject {
	
	public static final float DEFAULT_WIDTH = 4f;
	public static final float DEFAULT_OFFSET = DEFAULT_WIDTH + 0.1f;
	
	public Cube(final float width) {
		float w = width / 2;

		// Front
		Square front = new Square(width);
		front.setPosition(0, 0, w);
		children.add(front);
		// Right
		Square right = new Square(width);
		right.setPosition(w, 0, 0);
		right.setRotationY(90);
		children.add(right);
		// Back
		Square back = new Square(width);
		back.setPosition(0, 0, -w);
		back.setRotationY(180);
		children.add(back);
		// Left
		Square left = new Square(width);
		left.setPosition(-w, 0, 0);
		left.setRotationY(270);
		children.add(left);
		// bottom
		Square bottom = new Square(width);
		bottom.setPosition(0, -w, 0);
		bottom.setRotationX(90);
		children.add(bottom);
		// top
		Square top = new Square(width);
		top.setPosition(0, w, 0);
		top.setRotationX(270);
		children.add(top);
    }
}
